<?php
declare(strict_types=1);

namespace App\Http\Controllers\Image;

use App\Http\Controllers\Controller;
use App\Http\Requests\Image\ImageValidate;
use App\Library\Response;
use App\Logic\User\Service\Image\ImageCollectionService;
use Illuminate\Http\JsonResponse;

class ImageCollectionController extends Controller
{
    public function collection(ImageValidate $validate): JsonResponse
    {
        $collectionResult = (new ImageCollectionService())->serviceCreate(request()->all());
        if ($collectionResult["code"] == 0) {
            return Response::success($collectionResult, 100, $collectionResult["msg"]);
        }
        return Response::error($collectionResult, 101, $collectionResult["msg"]);
    }
}
